﻿#ifndef NEWTCPIOHANDLER_H
#define NEWTCPIOHANDLER_H

#include <qobject.h>
#include "ObjAutoInject.h"
#include <qtimer.h>

class TcpListener;
class TcpIOer;
class TcpCodec;
class NewTcpIOHandler : public QObject,public ObjAutoInject
{
  Q_OBJECT
private://property
  int maxRegisterTime=60*1000;
private://dependency
  TcpListener* tcpListener=Q_NULLPTR;
  TcpCodec* tcpCodec=Q_NULLPTR;
public:
  explicit NewTcpIOHandler();
  virtual ~NewTcpIOHandler();
signals:
public slots:
  void slot_newTcpConnection(TcpIOer* newTCPSocket);
public://geter and seter
  TcpListener* getTCPListener()const;
  NewTcpIOHandler* setTCPListener(TcpListener * const tcpListener);
  TcpCodec* getTcpCodec()const;
  NewTcpIOHandler* setTcpCodec(TcpCodec * const tcpCodec);
public:
  virtual void objectAutoInjection(QHash<QString,QObject*>* objMap);
};

#endif // NEWTCPIOHANDLER_H
